import axios from "axios"


export const request = axios.create({
    baseURL:"https://conduit.productionready.io"
})

export default ({ store })=>{
      request.interceptors.request.use((config)=>{
          if(store.state.user.user.token){
              console.log(store.state.user.user.token)
              config.headers.Authorization = `Token ${store.state.user.user.token}`
          }
          return config
      },error=>{
         return Promise.reject(error)
      })
}